﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IcbcOpenDemo.Models.Tools
{
    // 一个工具类，可生成msg_id,tran_date,tran_time
    public static class SeqNo
    {
        const string MSGIDHEAD = "ZSICBC";

        static private int i = 0;

        /// <summary>
        /// 返回yyyyMMdd
        /// </summary>
        static public string TranDate
        {
            get { return DateTime.Now.ToString("yyyyMMdd"); }
        }

        /// <summary>
        /// 返回HHmmssfff
        /// </summary>
        static public string TranTime
        {
            get { return DateTime.Now.ToString("HHmmssfff"); }
        }

        /// <summary>
        /// 返回yyyy-MM-dd HH:mm:ss
        /// </summary>
        static public string TimeStamp
        {
            get { return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); }
        }

        static public string Msg_ID
        {
            get { return MSGIDHEAD + TranDate + TranTime + (++i).ToString(); }
        }

        static public string FSeqNo
        {
            get { return Msg_ID; }
        }
    }
}